package com.fin.zw.aiqas.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author: qijigui
 * @CreateDate: 2019/10/18 17:26
 * @Description:
 */
@Service
public class AsyncTestService {

    @Async
    public void printInfo() {
        for (int i = 0; i < 1000; i++) {
            try {
                Thread.sleep(1);
                System.out.println("当前线程名称：" + Thread.currentThread().getName() + "，计数：" + i);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
